// 创建一个名为"demoDB"的DB
mdb = db.getSiblingDB('demoDB');
// 创建一个名为"demo"的用户，设置密码和权限
mdb.createUser(
    {
        user: "demo",
        pwd: "demoPassword",
        roles: [
            { role: "dbOwner", db: "demoDB" }
        ]
    }
);
// 在"newDB"中创建一个名为"demoCollection"的Collection
mdb.createCollection("demoCollection"); 